<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>选项卡功能</title>
		<style type="text/css">
			#div1{
				width: 300px;
				height: 300px;
				background-color: #BEBEBE;
				border: 2px #FFA500 solid;
				text-align: center;
				font-size: 30px;
			}
			img{
				width: 250px;
				height: 250px;
			}
		</style>
	</head>
	<body>
		<div id="div1">
			<button type="button" id="btn1">照片1</button>
			<button type="button" id="btn2">照片2</button>
			<button type="button" id="btn3">照片3</button>
			<button type="button" id="btn4">照片4</button>
			<img src="../images/con1.jpg" id="img">
			
		</div>
		
		<script type="text/javascript">
		window.onload = function(){
			var btn1 = document.getElementById("btn1");
			var btn2= document.getElementById("btn2");
			var btn3 = document.getElementById("btn3");
			var btn4 = document.getElementById("btn4");
			var img = document.getElementById("img");
			function  getId(event){
				document.getElementById(event);
			}
			btn1.onclick = function(){
				img.src='../images/con1.jpg';
			}
			btn2.onclick = function(){
				img.src='../images/con2.jpg';
			}
			btn3.onclick = function(){
				img.src='../images/con3.jpg';
			}
			btn4.onclick = function(){
				img.src='../images/con4.jpg';
			}
		};
			
		</script>
	</body>
</html>
